# -*- coding: utf-8 -*-
"""
Created on Thu Nov 15 19:34:58 2018

@author: 陈忠涛
"""

import wx
 
class MyFrame(wx.Frame):
    # 类似于构造函数
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, title = title)
        self.panel = wx.Panel(self)
        self.panel.Bind(wx.EVT_LEFT_UP, self.OnClick)
        self.Show(True)
        
    # 事件函数
    def OnClick(self, event):
        posm = event.GetPosition()
        wx.StaticText(self.panel, label = "你好", pos = (posm.x, posm.y))
 
if __name__ == '__main__':
    app = wx.App()
    frame = MyFrame(None, 'Hello Python')
    app.MainLoop()